﻿using NicoView.Model.Share.Service.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace NicoView.Model.Service.Events
{
    public class NicoServiceRequieSetEventArgs : NicoEventArgs
    {
        public string EventDescription { get; set; }

        public event NicoAuthSet OnSet;

        public NicoUserAuth BaseAuth { get; set; }

        public bool IsRegistration { get; set; }

        public void Set(NicoUserAuth auth)
        {
            IsRegistration = true;
            if (OnSet != null) OnSet(new NicoAuthSetEventArgs { Auth = auth });
        }

        public NicoServiceRequieSetEventArgs(string description) : this(description, new NicoPlaneUserAuth()) { }

        public NicoServiceRequieSetEventArgs(string description,NicoUserAuth auth)
        {
            EventDescription = description;
            IsRegistration = false;
            BaseAuth = auth;
            OnSet = null;
        }
    }

    public delegate void NicoAuthSet(NicoAuthSetEventArgs args);

    public class NicoAuthSetEventArgs:NicoEventArgs
    {
        public NicoUserAuth Auth;

        public NicoAuthSetEventArgs()
        {
            Auth = null;
        }
    }
}
